/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package objects;

import OBJ_Loader.Face;
import OBJ_Loader.ObjManager;
import graphic.Graphic;
import graphic.WorldConfig;
import org.lwjgl.util.vector.Vector3f;

/**
 *
 * @author nicra
 */
public class Walls {
    public static Wall[] list = new Wall[10];
    public static int ID;
    public static void draw(){
        Graphic.e.setColor(WorldConfig.WALL_COLOR);
        Graphic.e.drawList(ID);
    }
    
    public static void compile(){
        Graphic.e.startList(ID);
        {
            Graphic.e.startDrawT();
            for(Wall w:list)
                w.draw();
            Graphic.e.endDraw();
        }
        Graphic.e.endList();        
    }
    
    public static void init(float x,float y){
        ID=Graphic.e.createList();
    list[0] = new Wall(new Vector3f(-x/2+WorldConfig.PATH_WIDTH,0,0),
                new Vector3f(x/2-WorldConfig.PATH_WIDTH,0,0),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
    list[1] = new Wall(new Vector3f(0,0,y/2-WorldConfig.PATH_WIDTH),
                new Vector3f(0,0,-y/2+WorldConfig.PATH_WIDTH),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
        
    list[2] = new Wall(new Vector3f(-x/2,0,WorldConfig.PATH_WIDTH),
                new Vector3f(-WorldConfig.PATH_WIDTH,0,WorldConfig.PATH_WIDTH),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
    list[3] = new Wall(new Vector3f(-x/2+WorldConfig.PATH_WIDTH,0,-WorldConfig.PATH_WIDTH),
                new Vector3f(-WorldConfig.PATH_WIDTH,0,-WorldConfig.PATH_WIDTH),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
        
    list[4] = new Wall(new Vector3f(WorldConfig.PATH_WIDTH,0,WorldConfig.PATH_WIDTH),
                new Vector3f(x/2-WorldConfig.PATH_WIDTH,0,WorldConfig.PATH_WIDTH),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
    list[5] = new Wall(new Vector3f(WorldConfig.PATH_WIDTH,0,-WorldConfig.PATH_WIDTH),
                new Vector3f(x/2,0,-WorldConfig.PATH_WIDTH),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
        
    list[6] = new Wall(new Vector3f(WorldConfig.PATH_WIDTH,0,-y/2+WorldConfig.PATH_WIDTH),
                           new Vector3f(WorldConfig.PATH_WIDTH,0,-WorldConfig.PATH_WIDTH),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
    list[7] = new Wall(new Vector3f(-WorldConfig.PATH_WIDTH,0,-y/2),
                           new Vector3f(-WorldConfig.PATH_WIDTH,0,-WorldConfig.PATH_WIDTH),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
        
    list[8] = new Wall(new Vector3f(WorldConfig.PATH_WIDTH,0,WorldConfig.PATH_WIDTH),
                           new Vector3f(WorldConfig.PATH_WIDTH,0,y/2),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
    list[9] = new Wall(new Vector3f(-WorldConfig.PATH_WIDTH,0,WorldConfig.PATH_WIDTH),
                            new Vector3f(-WorldConfig.PATH_WIDTH,0,y/2-WorldConfig.PATH_WIDTH),
                WorldConfig.WALL_HEIGHT,WorldConfig.WALL_WIDTH,WorldConfig.WALL_COLOR);
    compile();
    }
}
